-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amethyst - Setharika Sok #84
base: main
Are you sure you want to change the base?
Conversation
}; | ||
|
||
const drawnHand = []; | ||
const allList = Object.entries(letters) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice Rika! This is a clever use of the Object.entries
method!
for (let j of input){ | ||
if (i.toUpperCase() === j.toUpperCase()) { | ||
++letterCount; | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨
sumPoint += 8; | ||
} | ||
// console.log(`sumPoint ${sumPoint}`); | ||
return sumPoint; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💫
let winnerWord = ""; | ||
let winnerScore = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we know we want to return these variables in object form, could just initialize said object here?
if (winnerScore < score) { | ||
winnerScore = score; | ||
winnerWord = word; | ||
} | ||
else if (winnerScore === score && word.length === 10 && winnerWord.length !== 10) { | ||
winnerScore = score; | ||
winnerWord = word; | ||
} | ||
else if (winnerScore === score && word.length < winnerWord.length && winnerWord.length !== 10) { | ||
winnerScore = score; | ||
winnerWord = word; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easy to follow! I love the compound if statements that you made as well!
} | ||
} | ||
console.log({ score: winnerScore, word: winnerWord }) | ||
return { score: winnerScore, word: winnerWord }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job, Rika! As you probably noticed, I didn't give too much feedback due to the scope of the project (Translating your python code to Javascript code). I tried to just point out any glaring issues, if any. With that being said, if you want to discuss anything in greater detail, feel free to reach out to me!
No description provided.